package com.huanzhidadi.mybatis.controller;

import com.huanzhidadi.mybatis.dao.UserDao;
import com.huanzhidadi.mybatis.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserDao userDao;

    @PostMapping("/list")
    List<User> findList(@RequestBody User user) {
        return userDao.selectList(user);
    }

}
